package com.example.suuu.project.system.entity;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.suuu.model.Pagination;
import com.example.suuu.tools.converter.GenderConverter;
import com.example.suuu.tools.excel.ExcelSelected;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * <p>
 * 用户表
 * </p>
 *
 * @author sun
 * @date 2023-06-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
//@Accessors(chain = true)
@ApiModel(value="su_user 表对应的实体对象", description="用户表")
@TableName("su_user")
@JsonIgnoreProperties(value = {"isdel","currentPage","pageSize","password"})
@ExcelIgnoreUnannotated
@HeadRowHeight(value = 35)
@ContentRowHeight(value = 25)
public class SuUser extends Pagination implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标识")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "昵称")
    @ExcelProperty(value = {"用户信息","昵称"},index = 1)
    @ColumnWidth(value = 40)
    @TableField(value = "nickname")
    private String nickname;

    @ApiModelProperty(value = "用户编号")
    @ExcelProperty(value = {"用户信息","用户编号"},index = 0)
    @TableField(value = "userCode")
    @ColumnWidth(value = 40)
    private String usercode;

    @ApiModelProperty(value = "职务编号")
    @TableField(value = "officeCode")
    private String officecode;

    @ApiModelProperty(value = "企业编号")
    @TableField(value = "enterpriseCode")
    private String enterprisecode;

    @ApiModelProperty(value = "部门编号")
    @TableField(value = "departmentCode")
    private String departmentcode;

    @ApiModelProperty(value = "手机号")
    @ExcelProperty(value = {"用户信息","手机号"},index = 2)
    @ColumnWidth(value = 40)
    @TableField(value = "phone")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    @ExcelProperty(value = {"用户信息","邮箱"},index = 3)
    @ColumnWidth(value = 40)
    @TableField(value = "mailbox")
    private String mailbox;

    @ApiModelProperty(value = "账号")
    @ExcelProperty(value = {"用户信息","账号"},index = 4)
    @ColumnWidth(value = 40)
    @TableField(value = "username")
    private String username;

    @ApiModelProperty(value = "密码")
    @TableField(value = "password")
    private String password;

    @ApiModelProperty(value = "头像")
    @ExcelProperty(value = {"用户信息","头像"},index = 5)
    @ColumnWidth(value = 40)
    @TableField(value = "avatar")
    private String avatar;

    @ApiModelProperty(value = "性别  1 女  2 男  3 其他")
    @TableField(value = "sex")
    @ExcelSelected(source = {"女","男","其他"})
    @ExcelProperty(value = {"用户信息","性别"},index = 6,converter = GenderConverter.class)
    @ColumnWidth(value = 40)
    private Integer sex;

    @ApiModelProperty(value = "状态  1 启用   2 禁用")
    @TableField(value = "status")
    @ExcelProperty(value = {"用户信息","状态"},index = 7)
    @ColumnWidth(value = 40)
    private Integer status;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    private String remark;

    @ApiModelProperty(value = "是否删除   1 未删除   2 已删除")
    @TableField(value = "isdel")
    private Integer isdel;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "createTime")
    @ExcelProperty(value = {"用户信息","创建时间"},index = 8)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(value = 40)
    private LocalDateTime createtime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updateTime")
    @ExcelProperty(value = {"用户信息","更新时间"},index = 9)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(value = 40)
    private LocalDateTime updatetime;

    @ApiModelProperty(value = "操作人编号")
    @TableField(value = "operateUserCode")
    private String operateusercode;

    @ApiModelProperty(value = "排序")
    @ExcelProperty(value = {"用户信息","排序"},index = 10)
    @ColumnWidth(value = 40)
    @TableField(value = "sort")
    private Integer sort;
}